Socket
Socket
Sign inDemoInstall

postcss-clean

Package Overview
Dependencies
2
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-clean


Version published
Weekly downloads
9.7K
decreased by-19.5%
Maintainers
1
Install size
1.92 MB
Created
Weekly downloads
 

Changelog

Source

1.2.2 (2021-02-07)

Build

CI

Docs

Update

Upgrade

<a name="1.2.1"></a>

Readme

Source

postcss-clean GitHub Workflow Status (branch) NPM Coveralls branch NPM Monthly Downloads

PostCss plugin to minify your CSS

Compression will be handled by clean-css, which according to this benchmark is one of the top (probably the best) libraries for minifying CSS.

Install

With npm do:

npm install postcss-clean --save

Example

Input

.try {
  color: #607d8b;
  width: 32px;
}

Output

.try{color:#607d8b;width:32px}

Input

:host {
  display: block;
}

:host ::content {
  & > * {
    color: var(--primary-color);
  }
}

Output

:host{display:block}:host ::content>*{color:var(--my-color)}

Note this example assumes you combined postcss-clean with other plugins (e.g. postcss-nesting).

API

clean([options])

Note that postcss-clean is an asynchronous processor. It cannot be used like this:

var out = postcss([ clean() ]).process(css).css;
console.log(out)

Instead make sure your runner uses the async APIs:

postcss([ clean() ]).process(css).then(function(out) {
    console.log(out.css);
});
options

It simply proxies the clean-css options. See the complete list of options here.

Usage

See the PostCSS documentation for examples for your environment.

Contributing

Pull requests are welcome.

License

MIT © Leonardo Di Donato


Analytics

Keywords

FAQs

Last updated on 07 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc